/**
 * 组件: 用户头像组件
 * Author:Colin3dmax
 */
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {
    StyleSheet,
    View,
    Text,
    Image,
    TouchableOpacity,
} from 'react-native';
import Util from '../utils/util';


class UserHeadIcon extends Component {

    static propTypes = {
        item: PropTypes.object,
        source:PropTypes.string,
        imageStyle: View.propTypes.style,
        style: View.propTypes.style,
        onPress: PropTypes.func,
    }

    static defaultProps = {
        item: {
            imageUrl: require('./../../img/icon_head_01.jpg'),
        }
    }

    constructor(props) {
        super(props)
        this.state = {}
    }

    componentDidMount() {

    }

    render() {
        const {source, style, imageStyle, onPress} = this.props
        return (
            <TouchableOpacity style={[styles.iconTouch, style]} onPress={onPress}>
                <Image style={[styles.iconImage, imageStyle]} source={source}/>
            </TouchableOpacity>
        );
    }
}

const styles = StyleSheet.create({
    iconTouch: {},
    iconImage: {
        width: 74,
        height: 74,
        borderRadius: 4,
    },
});

export default UserHeadIcon;